package cn.iocoder.yudao.module.station.dal.mysql.fillrecord;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.station.dal.dataobject.fillrecord.FillRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.station.controller.admin.fillrecord.vo.*;

/**
 * 充装记录 Mapper
 *
 * @author 林子
 */
@Mapper
public interface FillRecordMapper extends BaseMapperX<FillRecordDO> {

    default PageResult<FillRecordDO> selectPage(FillRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FillRecordDO>()
                .eqIfPresent(FillRecordDO::getStationIdcho, reqVO.getStationIdcho())
                .eqIfPresent(FillRecordDO::getStationCode, reqVO.getStationCode())
                .eqIfPresent(FillRecordDO::getBarcode, reqVO.getBarcode())
                .eqIfPresent(FillRecordDO::getCylinderCode, reqVO.getCylinderCode())
                .eqIfPresent(FillRecordDO::getChipCode, reqVO.getChipCode())
                .eqIfPresent(FillRecordDO::getGunSn, reqVO.getGunSn())
                .eqIfPresent(FillRecordDO::getScaleSn, reqVO.getScaleSn())
                .betweenIfPresent(FillRecordDO::getFillDate, reqVO.getFillDate())
                .betweenIfPresent(FillRecordDO::getFillTime, reqVO.getFillTime())
                .eqIfPresent(FillRecordDO::getFillDuration, reqVO.getFillDuration())
                .eqIfPresent(FillRecordDO::getCylinderTypeCode, reqVO.getCylinderTypeCode())
                .likeIfPresent(FillRecordDO::getCylinderTypeName, reqVO.getCylinderTypeName())
                .eqIfPresent(FillRecordDO::getGasCylinderSpeci, reqVO.getGasCylinderSpeci())
                .eqIfPresent(FillRecordDO::getFillMediumCode, reqVO.getFillMediumCode())
                .likeIfPresent(FillRecordDO::getFillMediumName, reqVO.getFillMediumName())
                .eqIfPresent(FillRecordDO::getCylinderModelCode, reqVO.getCylinderModelCode())
                .likeIfPresent(FillRecordDO::getCylinderModelName, reqVO.getCylinderModelName())
                .betweenIfPresent(FillRecordDO::getMakeTime, reqVO.getMakeTime())
                .eqIfPresent(FillRecordDO::getMakeFactoryCode, reqVO.getMakeFactoryCode())
                .likeIfPresent(FillRecordDO::getMakeFactoryName, reqVO.getMakeFactoryName())
                .betweenIfPresent(FillRecordDO::getRecentCheckTime, reqVO.getRecentCheckTime())
                .betweenIfPresent(FillRecordDO::getNextCheckTime, reqVO.getNextCheckTime())
                .eqIfPresent(FillRecordDO::getInitialWeight, reqVO.getInitialWeight())
                .eqIfPresent(FillRecordDO::getFillWeight, reqVO.getFillWeight())
                .eqIfPresent(FillRecordDO::getFullWeight, reqVO.getFullWeight())
                .eqIfPresent(FillRecordDO::getReweightDeviceCode, reqVO.getReweightDeviceCode())
                .eqIfPresent(FillRecordDO::getReweightWeight, reqVO.getReweightWeight())
                .eqIfPresent(FillRecordDO::getDataSource, reqVO.getDataSource())
                .eqIfPresent(FillRecordDO::getOperateUserCode, reqVO.getOperateUserCode())
                .likeIfPresent(FillRecordDO::getOperateUserName, reqVO.getOperateUserName())
                .eqIfPresent(FillRecordDO::getEnvirTempera, reqVO.getEnvirTempera())
                .eqIfPresent(FillRecordDO::getFillCheckRecordId, reqVO.getFillCheckRecordId())
                .eqIfPresent(FillRecordDO::getBeforeCheckStatus, reqVO.getBeforeCheckStatus())
                .eqIfPresent(FillRecordDO::getBeforeCheckUser, reqVO.getBeforeCheckUser())
                .betweenIfPresent(FillRecordDO::getBeforeCheckTime, reqVO.getBeforeCheckTime())
                .eqIfPresent(FillRecordDO::getAfterCheckStatus, reqVO.getAfterCheckStatus())
                .eqIfPresent(FillRecordDO::getAfterCheckUser, reqVO.getAfterCheckUser())
                .betweenIfPresent(FillRecordDO::getAfterCheckTime, reqVO.getAfterCheckTime())
                .eqIfPresent(FillRecordDO::getFillStatus, reqVO.getFillStatus())
                .betweenIfPresent(FillRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FillRecordDO::getId));
    }

    default List<FillRecordDO> selectList(FillRecordExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<FillRecordDO>()
                .eqIfPresent(FillRecordDO::getStationIdcho, reqVO.getStationIdcho())
                .eqIfPresent(FillRecordDO::getStationCode, reqVO.getStationCode())
                .eqIfPresent(FillRecordDO::getBarcode, reqVO.getBarcode())
                .eqIfPresent(FillRecordDO::getCylinderCode, reqVO.getCylinderCode())
                .eqIfPresent(FillRecordDO::getChipCode, reqVO.getChipCode())
                .eqIfPresent(FillRecordDO::getGunSn, reqVO.getGunSn())
                .eqIfPresent(FillRecordDO::getScaleSn, reqVO.getScaleSn())
                .betweenIfPresent(FillRecordDO::getFillDate, reqVO.getFillDate())
                .betweenIfPresent(FillRecordDO::getFillTime, reqVO.getFillTime())
                .eqIfPresent(FillRecordDO::getFillDuration, reqVO.getFillDuration())
                .eqIfPresent(FillRecordDO::getCylinderTypeCode, reqVO.getCylinderTypeCode())
                .likeIfPresent(FillRecordDO::getCylinderTypeName, reqVO.getCylinderTypeName())
                .eqIfPresent(FillRecordDO::getGasCylinderSpeci, reqVO.getGasCylinderSpeci())
                .eqIfPresent(FillRecordDO::getFillMediumCode, reqVO.getFillMediumCode())
                .likeIfPresent(FillRecordDO::getFillMediumName, reqVO.getFillMediumName())
                .eqIfPresent(FillRecordDO::getCylinderModelCode, reqVO.getCylinderModelCode())
                .likeIfPresent(FillRecordDO::getCylinderModelName, reqVO.getCylinderModelName())
                .betweenIfPresent(FillRecordDO::getMakeTime, reqVO.getMakeTime())
                .eqIfPresent(FillRecordDO::getMakeFactoryCode, reqVO.getMakeFactoryCode())
                .likeIfPresent(FillRecordDO::getMakeFactoryName, reqVO.getMakeFactoryName())
                .betweenIfPresent(FillRecordDO::getRecentCheckTime, reqVO.getRecentCheckTime())
                .betweenIfPresent(FillRecordDO::getNextCheckTime, reqVO.getNextCheckTime())
                .eqIfPresent(FillRecordDO::getInitialWeight, reqVO.getInitialWeight())
                .eqIfPresent(FillRecordDO::getFillWeight, reqVO.getFillWeight())
                .eqIfPresent(FillRecordDO::getFullWeight, reqVO.getFullWeight())
                .eqIfPresent(FillRecordDO::getReweightDeviceCode, reqVO.getReweightDeviceCode())
                .eqIfPresent(FillRecordDO::getReweightWeight, reqVO.getReweightWeight())
                .eqIfPresent(FillRecordDO::getDataSource, reqVO.getDataSource())
                .eqIfPresent(FillRecordDO::getOperateUserCode, reqVO.getOperateUserCode())
                .likeIfPresent(FillRecordDO::getOperateUserName, reqVO.getOperateUserName())
                .eqIfPresent(FillRecordDO::getEnvirTempera, reqVO.getEnvirTempera())
                .eqIfPresent(FillRecordDO::getFillCheckRecordId, reqVO.getFillCheckRecordId())
                .eqIfPresent(FillRecordDO::getBeforeCheckStatus, reqVO.getBeforeCheckStatus())
                .eqIfPresent(FillRecordDO::getBeforeCheckUser, reqVO.getBeforeCheckUser())
                .betweenIfPresent(FillRecordDO::getBeforeCheckTime, reqVO.getBeforeCheckTime())
                .eqIfPresent(FillRecordDO::getAfterCheckStatus, reqVO.getAfterCheckStatus())
                .eqIfPresent(FillRecordDO::getAfterCheckUser, reqVO.getAfterCheckUser())
                .betweenIfPresent(FillRecordDO::getAfterCheckTime, reqVO.getAfterCheckTime())
                .eqIfPresent(FillRecordDO::getFillStatus, reqVO.getFillStatus())
                .betweenIfPresent(FillRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FillRecordDO::getId));
    }

}
